package org.hako.recite.word.test;

/**
 * Profile of {@link WordTest}.
 * 
 * @since 0.4.0
 * @author <a href="mailto:xnnyygn@gmail.com">xnnyygn</a>
 */
public class WordTestProfile {

	public static final int RANDOM_MODE_PART = 0;
	public static final int RANDOM_MODE_ENTIRE = 1;
	private int wordOffset = 0;
	private int wordLimit = 10;
	private int wordRangeStart = 0;
	private int wordRangeEnd = -1;
	private int questionFieldIndex = 0;
	private int answerFieldIndex = 1;
	private int randomMode = 0;
	private boolean random = true;
	private boolean retestWrongs = true;

	/**
	 * Get wordOffset.
	 * 
	 * @return the wordOffset
	 */
	public int getWordOffset() {
		return wordOffset;
	}

	/**
	 * Set wordOffset.
	 * 
	 * @param wordOffset
	 *            the wordOffset to set
	 */
	public void setWordOffset(int wordOffset) {
		this.wordOffset = wordOffset;
	}

	/**
	 * Get wordLimit.
	 * 
	 * @return the wordLimit
	 */
	public int getWordLimit() {
		return wordLimit;
	}

	/**
	 * Set wordLimit.
	 * 
	 * @param wordLimit
	 *            the wordLimit to set
	 */
	public void setWordLimit(int wordLimit) {
		this.wordLimit = wordLimit;
	}

	/**
	 * Get wordRangeStart.
	 * 
	 * @return the wordRangeStart
	 */
	public int getWordRangeStart() {
		return wordRangeStart;
	}

	/**
	 * Set wordRangeStart.
	 * 
	 * @param wordRangeStart
	 *            the wordRangeStart to set
	 */
	public void setWordRangeStart(int wordRangeStart) {
		this.wordRangeStart = wordRangeStart;
	}

	/**
	 * Get wordRangeEnd.
	 * 
	 * @return the wordRangeEnd
	 */
	public int getWordRangeEnd() {
		return wordRangeEnd;
	}

	/**
	 * Set wordRangeEnd.
	 * 
	 * @param wordRangeEnd
	 *            the wordRangeEnd to set
	 */
	public void setWordRangeEnd(int wordRangeEnd) {
		this.wordRangeEnd = wordRangeEnd;
	}

	/**
	 * Get questionFieldIndex.
	 * 
	 * @return the questionFieldIndex
	 */
	public int getQuestionFieldIndex() {
		return questionFieldIndex;
	}

	/**
	 * Set questionFieldIndex.
	 * 
	 * @param questionFieldIndex
	 *            the questionFieldIndex to set
	 */
	public void setQuestionFieldIndex(int questionFieldIndex) {
		this.questionFieldIndex = questionFieldIndex;
	}

	/**
	 * Get answerFieldIndex.
	 * 
	 * @return the answerFieldIndex
	 */
	public int getAnswerFieldIndex() {
		return answerFieldIndex;
	}

	/**
	 * Set answerFieldIndex.
	 * 
	 * @param answerFieldIndex
	 *            the answerFieldIndex to set
	 */
	public void setAnswerFieldIndex(int answerFieldIndex) {
		this.answerFieldIndex = answerFieldIndex;
	}

	/**
	 * Get randomMode.
	 * 
	 * @return the randomMode
	 */
	@Deprecated
	public int getRandomMode() {
		return randomMode;
	}

	/**
	 * Set randomMode.
	 * 
	 * @param randomMode
	 *            the randomMode to set
	 */
	@Deprecated
	public void setRandomMode(int randomMode) {
		this.randomMode = randomMode;
	}

	/**
	 * Get test mode.
	 * 
	 * @return
	 */
	public WordTestMode getTestMode(){
		
		// TODO use better code
		return WordTestMode.values()[randomMode];
	}
	/**
	 * Set test mode.
	 * 
	 * @param mode
	 */
	public void setTestMode(WordTestMode mode) {
		switch (mode) {
		case LEARNING:
			this.randomMode = 0;
			break;
		case TEST:
			this.randomMode = 1;
			break;
		}
	}

	/**
	 * Get random.
	 * 
	 * @return the random
	 */
	public boolean isRandom() {
		return random;
	}

	/**
	 * Set random.
	 * 
	 * @param random
	 *            the random to set
	 */
	public void setRandom(boolean random) {
		this.random = random;
	}

	/**
	 * Get retestWrongs.
	 * 
	 * @return the retestWrongs
	 */
	public boolean isRetestWrongs() {
		return retestWrongs;
	}

	/**
	 * Set retestWrongs.
	 * 
	 * @param retestWrongs
	 *            the retestWrongs to set
	 */
	public void setRetestWrongs(boolean retestWrongs) {
		this.retestWrongs = retestWrongs;
	}

}
